import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Java_web {
    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            String url="jdbc:mysql://127.0.0.1:3306/student?serverTimezone=Asia/Shanghai";
            String userName="root";
            String password="123456";
            Connection connection = DriverManager.getConnection(url,userName,password);
            //
            String sql ="update student_info set student_name='xzh' where id = 1;";
            //
            Statement statement = connection.createStatement();
            //
            int count = statement.executeUpdate(sql);
            if (count==1){
                System.out.println("cg");
            }
        } catch (Exception e) {
            e.printStackTrace();

        }
    }
}
